package com.learn.pay.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;


/**
 * @author : Yu.Tan
 * @date : 2023/1/11 17:43
 * @desc : **
 */
//@Profile("dev")
@Configuration
//@EnableSwagger2
public class SwaggerConfiguration {

    @Bean
    public Docket creatRestApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .pathMapping("/")
                .select()
//                .apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
                .apis(RequestHandlerSelectors.basePackage("com.learn.pay"))
                .paths(PathSelectors.any())
                .build().apiInfo(new ApiInfoBuilder()
                        .title("Mbatis_Plus_Demo")
                        .description("Mbatis_Plus_Demo响应格式.详细信息.................")
                        .version("1.0")
                        .contact(new Contact("邮件", "http://www.baidu.com", "aaa@gmail.com"))
                        .license("The Apache License")
                        .licenseUrl("http://www.baidu.com")
                        .build())
                ;
    }

}
